import pytest
from pathlib import Path
from fileorganizer.core import FileOrganizer

@pytest.fixture
def sample_dir(tmp_path):
    (tmp_path / "test.txt").touch()
    (tmp_path / "image.jpg").touch()
    return tmp_path

def test_analyze_files(sample_dir):
    organizer = FileOrganizer(sample_dir)
    organizer.analyze_files()
    assert organizer.file_types == {"txt": ["test.txt"], "jpg": ["image.jpg"]}